<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>货运单信息</title>
<style type="text/css">
	div,table{
		width: 80%;
	}
	table{
		border-collapse: collapse;
		border: 1px solid #ccc;
		text-align: center;
	}
	.table td{
		border: 1px solid #ccc;
	}
	.div{
		margin-top: 2%;
	}
	caption{
		color: red;
	}
	
</style>
</head>
<body>
<center>
<div>
	<div class="div">
	<form action="${pageContext.request.contextPath }/cargo/addCargoInfo.do" method="post">
		<table>
			<caption>单件物品信息输入</caption>
			<tr>
				<td>长</td>
				<td><input type="text" name="length"></td>
				<td>宽</td>
				<td><input type="text" name="width"></td>
				<td>高</td>
				<td><input type="text" name="height"></td>
				<td>单位</td>
				<td>
					<select name="unit">
						<option value="0">英寸</option>
						<option value="1">厘米</option>
					</select>
				</td>
				<td><input type="submit" value="添加"></td>
			</tr>
		</table>
	</form>
	</div>
	<form action="${pageContext.request.contextPath }/cargo/addCargo.do" method="post" enctype="multipart/form-data">
		<div class="div">
			<table style="text-align: left;">
				<caption>运单信息</caption>
				<tr>
					<td>总提单号:</td>
					<td><input type="text" name="totalOrderNu"></td>
					<td>分单号:</td>
					<td><input type="text" name="pointOrderNu"></td>
				</tr>
				<tr>
					<td>毛重:</td>
					<td><input type="text" name="heavy"></td>
					<td>Pdf文件上传:</td>
					<td><input type="file" name="file"></td>
				</tr>
				<tr>
					<td>选择运输公司:</td>
					<td>
						<select name="fleetId">
							<option>--选择运输公司--</option>
<c:forEach var="fl" items="${fleetlist }">
							<option value="${fl.companyId }">${fl.companyName }</option>				
</c:forEach>
						</select>
					</td>
					<td>选择报关行:</td>
					<td>
						<select name="brokerId">
							<option>--选择报关公司--</option>
<c:forEach var="bl" items="${brokerlist }">
							<option value="${bl.companyId }">${bl.companyName }</option>				
</c:forEach>
						</select>
					</td>
				</tr>
				<tr>
					<td>件数:</td>
					<td><input type="text" name="count"></td>
					<td></td>
					<td></td>
				</tr>
			</table>
		</div>
		<div class="div">
			<table class="table">
				<caption>展示单件物品信息</caption>
				<tr>
					<td>序号</td>
					<td>长</td>
					<td>宽</td>
					<td>高</td>
					<td>单位</td>
					<td>操作</td>
				</tr>
			<c:if test="${empty cargoInfolist }">
				<tr>
					<td colspan="6">暂时没有数据</td>
				</tr>
			</c:if>
			<c:if test="${not empty cargoInfolist }">
			<c:forEach items="${cargoInfolist }" var="cil" varStatus="vs">
				<tr>
					<td>${vs.count }</td>
					<td>${cil.length }</td>
					<td>${cil.width }</td>
					<td>${cil.height }</td>
					<c:if test="${cil.unit==0 }">
					<td>英寸</td>
					</c:if>
					<c:if test="${cil.unit==1 }">
					<td>厘米</td>
					</c:if>
					<td>
						<a href="${pageContext.request.contextPath }/cargo/deleteCargoInfo.do?infoId=${cil.infoId }">删除</a>
						&nbsp;&nbsp;&nbsp;
						<a href="">修改</a>
					</td>
				</tr>
			</c:forEach>
			</c:if>
			</table>
			<!-- 添加短驳运输 、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、-->
			<p>
			<table style="text-align: left">
			<caption>市内运输</caption>
			<tr>
				<td>选择运输公司:
					<select name="companyId">
						<option>--选择运输公司--</option>
<c:forEach var="fl" items="${fleetlist }">
						<option value="${fl.companyId }">${fl.companyName }</option>				
</c:forEach>
					</select>
				</td>
			</tr>
			<tr>
				<td colspan="1">
					<select name="addressId">
						<option>--选择常用地址--</option>
<c:forEach var="al" items="${addresslist }">
						<option value="${al.addressId }">详细地址:${al.detailed }/联系人:${al.name }/联系方式:${al.phone }</option>				
</c:forEach>
					</select>
				</td>
			</tr>	
		</table>
		</div>
		<div>
					
		</div>
		<div class="div sub"><input type="submit" value="提交" style="width:120px;font-size: 25px"></div>
	</form>
	
	
</div>
</center>
</body>
</html>